// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 添加待办事项 POST /todo/add */
export async function addTodo(body: API.TodoEntity, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/todo/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据日期获取待办事项 GET /todo/date/get */
export async function getTodoByCurrentDate(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getTodoByCurrentDateParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListTodoEntity>('/todo/date/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 根据id删除待办事项 GET /todo/del/${param0} */
export async function deleteTodo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteTodoParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/todo/del/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 根据用户id获取待办事项列表 GET /todo/list */
export async function listTodoByUserId(options?: { [key: string]: any }) {
  return request<API.BaseResponseMapStringListTodoVO>('/todo/list', {
    method: 'GET',
    ...(options || {}),
  });
}
